#pragma once
#include "IRule.h"

class ParseTree;

class TypeChecker
{
    static IRule* rules;

public:
    TypeChecker();
    ~TypeChecker();

    static void setRules(IRule* rules);
    static void checkPROG(ParseTree* tree);
    static void checkDECLS(ParseTree* tree);
    static void checkDECLSe(ParseTree* tree);
    static void checkDECL(ParseTree* tree);
    static void checkARRAY(ParseTree* tree);
    static void checkARRAYe(ParseTree* tree);
    static void checkSTATEMENTS(ParseTree* tree);
    static void checkSTATEMENTSe(ParseTree* tree);
    static void checkSTATEMENT_ASSIGN(ParseTree* tree);
    static void checkSTATEMENT_PRINT(ParseTree* tree);
    static void checkSTATEMENT_READ(ParseTree* tree);
    static void checkSTATEMENT_CURLY_BR_OPEN(ParseTree* tree);
    static void checkSTATEMENT_IF(ParseTree* tree);
    static void checkSTATEMENT_WHILE(ParseTree* tree);
    static void checkEXP(ParseTree* tree);
    static void checkEXP2_BR_OPEN(ParseTree* tree);
    static void checkEXP2_IDENTIFIER(ParseTree* tree);
    static void checkEXP2_INTEGER(ParseTree* tree);
    static void checkEXP2_MINUS(ParseTree* tree);
    static void checkEXP2_EXCL(ParseTree* tree);
    static void checkINDEX(ParseTree* tree);
    static void checkINDEXe(ParseTree* tree);
    static void checkOP_EXP(ParseTree* tree);
    static void checkOP_EXPe(ParseTree* tree);
    static void checkOP(ParseTree* tree);
    static void checkOP_PLUS   (ParseTree* tree);
    static void checkOP_MINUS  (ParseTree* tree);
    static void checkOP_MULT   (ParseTree* tree);
    static void checkOP_DIV    (ParseTree* tree);
    static void checkOP_LESS   (ParseTree* tree);
    static void checkOP_GREATER(ParseTree* tree);
    static void checkOP_EQUAL  (ParseTree* tree);
    static void checkOP_UNEQUAL(ParseTree* tree);
    static void checkOP_AND    (ParseTree* tree);
};
